package main

func canConstruct(ransomNote string, magazine string) bool {
	rm := make(map[byte]int)
	for _, b := range ransomNote {
		rm[byte(b)]++
	}
	mm := make(map[byte]int)
	for _, b := range magazine {
		mm[byte(b)]++
	}
	for char, required := range rm {
		provided := mm[char]
		if provided < required {
			return false
		}
	}
	return true
}